package com.jbookshelf.dal.entities;
// Generated 22.12.2012 21:50:33 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * OrderStatuses generated by hbm2java
 */
@Entity
@Table(name = "ORDER_STATUSES", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = "NAME"))
public class OrderStatuses implements java.io.Serializable {

	private Integer id;
	private String name;
	private String description;
	private Set<OrdersHistory> ordersHistories = new HashSet<OrdersHistory>(0);
	private Set<Orders> orderses = new HashSet<Orders>(0);

	public OrderStatuses() {
	}

	public OrderStatuses(String name) {
		this.name = name;
	}

	public OrderStatuses(String name, String description,
			Set<OrdersHistory> ordersHistories, Set<Orders> orderses) {
		this.name = name;
		this.description = description;
		this.ordersHistories = ordersHistories;
		this.orderses = orderses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "NAME", unique = true, nullable = false, length = 64)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "DESCRIPTION", length = 256)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "orderStatuses")
	public Set<OrdersHistory> getOrdersHistories() {
		return this.ordersHistories;
	}

	public void setOrdersHistories(Set<OrdersHistory> ordersHistories) {
		this.ordersHistories = ordersHistories;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "orderStatuses")
	public Set<Orders> getOrderses() {
		return this.orderses;
	}

	public void setOrderses(Set<Orders> orderses) {
		this.orderses = orderses;
	}

}
